package day1020;

import java.util.ArrayList;
import java.util.List;

public class Test2 {

    public static void main(String[] args) {


        //定义一个list变量类型ArrayList，指代一个ArrayList对象
        List<String>   list=   new ArrayList<>();
        list.add("张三");
        list.add("李四");

        for (int i = 0; i < list.size(); i++) {
            String ele=list.get(i);
            System.out.println(ele);
        }

        for( String   ele :  list){
            System.out.println(ele);
        }


    }


}









